package com.woniuxy.controller;

import com.woniuxy.entity.RbacRoleMenuDTO;
import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.service.RbacRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: 马宇航
 * @Todo: TODO
 * @DateTime: 22/04/18/0018 下午 2:33
 * @Component: 成都蜗牛学苑
 **/
@RestController
@RequestMapping("/rbacRole")
public class RbacRoleController {
    @Autowired
    RbacRoleService rbacRoleService;
    @GetMapping("/findAll/{currentPage}/{pageSize}")
    public ResponseEntity findAll(@PathVariable int currentPage,@PathVariable int pageSize){
       return rbacRoleService.findAll(currentPage,pageSize);
    }
    @GetMapping("/checked/{roleId}")
    public ResponseEntity checkedRole(@PathVariable int roleId){
        return rbacRoleService.checkedRole(roleId);
    }
    @PostMapping("/schangeMenus")
    public ResponseEntity changeMenus(@RequestBody RbacRoleMenuDTO rbacRoleMenuDTO){
        return rbacRoleService.changeMenus(rbacRoleMenuDTO);
    }
}
